package ms.maplestory.boot.client.character.quest.reward;

import lombok.Getter;
import lombok.Setter;
import ms.maplestory.boot.client.character.Char;
import ms.maplestory.boot.loaders.DatSerializable;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

@Getter
@Setter
public class QuestItemReward implements QuestReward {

    private int id;
    private int quantity;
    private int status;
    private int prop;
    private int gender;
    private int job;

    @Override
    public void giveReward(Char chr) {

    }

    @Override
    public void write(DataOutputStream dos) throws IOException {
        dos.writeInt(getId());
        dos.writeInt(getQuantity());
        dos.writeInt(getStatus());
        dos.writeInt(getProp());
        dos.writeInt(getGender());
        dos.writeInt(getJob());
    }

    @Override
    public DatSerializable load(DataInputStream dis) throws IOException {
        QuestItemReward questItemReward = new QuestItemReward();
        questItemReward.setId(dis.readInt());
        questItemReward.setQuantity(dis.readInt());
        questItemReward.setStatus(dis.readInt());
        questItemReward.setProp(dis.readInt());
        questItemReward.setGender(dis.readInt());
        questItemReward.setJob(dis.readInt());
        return questItemReward;
    }
}
